package cuit.campus.taskRunning.user.controller;

import cuit.campus.taskRunning.commons.response.Result;
import cuit.campus.taskRunning.user.entry.po.Task;
import cuit.campus.taskRunning.user.serivce.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/tasks")
public class TaskController {
    @Autowired
    private TaskService taskService;

    @PostMapping("/add")
    public Result addTask(@RequestBody Task task){
        taskService.insert(task);
        return Result.ok();
    }
}
